package com.example.demo.controller;

import com.example.demo.pojo.Pets;
import com.example.demo.pojo.Result;
import com.example.demo.pojo.Seller;
import com.example.demo.service.IPetsService;
import com.example.demo.service.ISellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/seller")
@Validated
public class SellerController {
	@Autowired
	private ISellerService sellerService;
	@GetMapping("/list/{sellerID}")
	public Result findByID(@PathVariable Integer sellerID) {
		List<Seller> list=sellerService.findByID(sellerID);
		return Result.success(list);
	}
	@GetMapping("/listAll")
	public Result findAll() {
		List<Seller> list=sellerService.findAll();
		return Result.success(list);
	}
	@GetMapping("/listSeller/{goodsID}")
	public Result findBygoodsID(@PathVariable Integer goodsID) {
		List<Seller> list=sellerService.findBygoodsID(goodsID);
		return Result.success(list);
	}

}
